<?php

namespace CMBUBank\UBank\Request\TransManager;

use CMBUBank\UBank\Request\UBankBaseRequest;
use CMBUBank\UBank\Response\TransManager\TransManagerSubunitControlResponse;
use CMBUBank\UBank\Response\TransManager\TransManagerSubunitWhiteAddResponse;

class TransManagerSubunitControlRequest extends UBankBaseRequest
{
    protected $code = 'NTDUMCTL';

    protected $response = TransManagerSubunitControlResponse::class;

    protected $logTip = '设置记账子单元入账控制';

    private $busMode;

    private $backNo;

    private $account;

    private $subCode;

    public function generate(): array
    {
        return [
            'ntbusmody' => [[
                'busmod' => $this->busMode
            ]],
            'ntdumctlx1' => [[
                'bbknbr' => $this->backNo,
                'accnbr' => $this->account,
                'dumnbr' => $this->subCode,
                'yurref' => $this->newReqCode()
            ]],
        ];
    }

    public function setBusMode($busMode): void
    {
        $this->busMode = $busMode;
    }

    public function setBackNo($backNo): void
    {
        $this->backNo = $backNo;
    }

    public function setAccount($account): void
    {
        $this->account = $account;
    }

    public function setSubCode($subCode): void
    {
        $this->subCode = $subCode;
    }
}